#ifndef _STATUS_TREE_H
#define _STATUS_TREE_H

#include <sys/stat.h>

#include "file_status.h"

typedef struct _sST sST;
struct _sST {
    sST *parent, *prev, *next, *child;

    char *name;
    sFS *files;
};

typedef void (*ST_HANDLER)(sST *);

inline sST *    ST_create           (char *name, sFS *fl);
sST *           ST_append           (sST **tree, char *name, sFS *fl);
inline sST *    ST_append_child     (sST *tree, char *name, sFS *fl);
sST *           ST_dup              (sST *src, unsigned int nd);
void            ST_remove_cb        (sST **tree, sST *el, ST_HANDLER cb);
inline void     ST_remove           (sST **tree, sST *el);
inline void     ST_remove_data      (sST **tree, sST *el);
void            ST_free_all_cb      (sST *tree, ST_HANDLER cb);
inline void     ST_free_all         (sST *tree);
inline void     ST_free_all_data    (sST *tree);

inline void     ST_print            (sST *tree);
inline void     ST_print_debug      (sST *tree, unsigned int nd);

#endif

